home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Games / MAME / src / drivers / mainevt.c < prev    next >
C/C++ Source or Header  |  2000-04-23  |  35KB  |  942 lines

  1. /***************************************************************************
  2.  
  3.   The Main Event, (c) 1988 Konami
  4.   Devastators, (c) 1988 Konami
  5.  
  6. Emulation by Bryan McPhail, mish@tendril.co.uk
  7.  
  8. Notes:
  9. - Schematics show a palette/work RAM bank selector, but this doesn't seem
  10.   to be used?
  11.  
  12. - In Devastators, shadows don't work. Bit 7 of the sprite attribute is always 0,
  13.   could there be a global enable flag in the 051960?
  14.   This is particularly evident in level 2 where plane shadows cover other sprites.
  15.   The priority/shadow encoder PROM is quite complex, however bits 5-7 of the sprite
  16.   attribute don't seem to be used, at least not in the first two levels, so the
  17.   PROM just maps to the fixed priority order currently implemented.
  18.  
  19. - In Devastators, sprite zooming for the planes in level 2 is particularly bad.
  20.  
  21. ***************************************************************************/
  22.  
  23. #include "driver.h"
  24. #include "vidhrdw/generic.h"
  25. #include "vidhrdw/konamiic.h"
  26. #include "cpu/m6809/m6809.h"
  27.  
  28.  
  29. void mainevt_vh_screenrefresh (struct osd_bitmap *bitmap,int full_refresh);
  30. void dv_vh_screenrefresh (struct osd_bitmap *bitmap,int full_refresh);
  31. int mainevt_vh_start (void);
  32. int dv_vh_start (void);
  33. void mainevt_vh_stop (void);
  34.  
  35.  
  36.  
  37. static int mainevt_interrupt(void)
  38. {
  39.     if (K052109_is_IRQ_enabled()) return M6809_INT_IRQ;
  40.     else return ignore_interrupt();
  41. }
  42.  
  43.  
  44. static int nmi_enable;
  45.  
  46. static WRITE_HANDLER( dv_nmienable_w )
  47. {
  48.     nmi_enable = data;
  49. }
  50.  
  51. static int dv_interrupt(void)
  52. {
  53.     if (nmi_enable) return M6809_INT_NMI;
  54.     else return ignore_interrupt();
  55. }
  56.  
  57.  
  58. WRITE_HANDLER( mainevt_bankswitch_w )
  59. {
  60.     unsigned char *RAM = memory_region(REGION_CPU1);
  61.     int bankaddress;
  62.  
  63.     /* bit 0-1 ROM bank select */
  64.     bankaddress = 0x10000 + (data & 0x03) * 0x2000;
  65.     cpu_setbank(1,&RAM[bankaddress]);
  66.  
  67.     /* TODO: bit 5 = select work RAM or palette? */
  68. //    palette_selected = data & 0x20;
  69.  
  70.     /* bit 6 = enable char ROM reading through the video RAM */
  71.     K052109_set_RMRD_line((data & 0x40) ? ASSERT_LINE : CLEAR_LINE);
  72.  
  73.     /* bit 7 = NINITSET (unknown) */
  74.  
  75.     /* other bits unused */
  76. }
  77.  
  78. WRITE_HANDLER( mainevt_coin_w )
  79. {
  80.     coin_counter_w(0,data & 0x10);
  81.     coin_counter_w(1,data & 0x20);
  82.     osd_led_w(0,data >> 0);
  83.     osd_led_w(1,data >> 1);
  84.     osd_led_w(2,data >> 2);
  85.     osd_led_w(3,data >> 3);
  86. }
  87.  
  88. WRITE_HANDLER( mainevt_sh_irqtrigger_w )
  89. {
  90.     cpu_cause_interrupt(1,0xff);
  91. }
  92.  
  93. WRITE_HANDLER( mainevt_sh_irqcontrol_w )
  94. {
  95.      /* I think bit 1 resets the UPD7795C sound chip */
  96.      if ((data & 0x02) == 0)
  97.      {
  98.          UPD7759_reset_w(0,(data & 0x02) >> 1);
  99.      }
  100.     else if ((data & 0x01))
  101.      {
  102.         UPD7759_start_w(0,0);
  103.      }
  104.  
  105.     interrupt_enable_w(0,data & 4);
  106. }
  107.  
  108. WRITE_HANDLER( devstor_sh_irqcontrol_w )
  109. {
  110. interrupt_enable_w(0,data & 4);
  111. }
  112.  
  113. WRITE_HANDLER( mainevt_sh_bankswitch_w )
  114. {
  115.     unsigned char *src,*dest;
  116.     unsigned char *RAM = memory_region(REGION_SOUND1);
  117.     int bank_A,bank_B;
  118.  
  119. //logerror("CPU #1 PC: %04x bank switch = %02x\n",cpu_get_pc(),data);
  120.  
  121.     /* bits 0-3 select the 007232 banks */
  122.     bank_A=0x20000 * (data&0x3);
  123.     bank_B=0x20000 * ((data>>2)&0x3);
  124.     K007232_bankswitch(0,RAM+bank_A,RAM+bank_B);
  125.  
  126.     /* bits 4-5 select the UPD7759 bank */
  127.     src = &memory_region(REGION_SOUND2)[0x20000];
  128.     dest = memory_region(REGION_SOUND2);
  129.     memcpy(dest,&src[((data >> 4) & 0x03) * 0x20000],0x20000);
  130. }
  131.  
  132. WRITE_HANDLER( dv_sh_bankswitch_w )
  133. {
  134.     unsigned char *RAM = memory_region(REGION_SOUND1);
  135.     int bank_A,bank_B;
  136.  
  137. //logerror("CPU #1 PC: %04x bank switch = %02x\n",cpu_get_pc(),data);
  138.  
  139.     /* bits 0-3 select the 007232 banks */
  140.     bank_A=0x20000 * (data&0x3);
  141.     bank_B=0x20000 * ((data>>2)&0x3);
  142.     K007232_bankswitch(0,RAM+bank_A,RAM+bank_B);
  143. }
  144.  
  145.  
  146. static struct MemoryReadAddress readmem[] =
  147. {
  148.     { 0x1f94, 0x1f94, input_port_0_r }, /* Coins */
  149.     { 0x1f95, 0x1f95, input_port_1_r }, /* Player 1 */
  150.     { 0x1f96, 0x1f96, input_port_2_r }, /* Player 2 */
  151.     { 0x1f97, 0x1f97, input_port_5_r }, /* Dip 1 */
  152.     { 0x1f98, 0x1f98, input_port_7_r }, /* Dip 3 */
  153.     { 0x1f99, 0x1f99, input_port_3_r }, /* Player 3 */
  154.     { 0x1f9a, 0x1f9a, input_port_4_r }, /* Player 4 */
  155.     { 0x1f9b, 0x1f9b, input_port_6_r }, /* Dip 2 */
  156.  
  157.     { 0x0000, 0x3fff, K052109_051960_r },
  158.     { 0x4000, 0x5fff, MRA_RAM },
  159.     { 0x6000, 0x7fff, MRA_BANK1 },
  160.     { 0x8000, 0xffff, MRA_ROM },
  161.     { -1 }    /* end of table */
  162. };
  163.  
  164. static struct MemoryWriteAddress writemem[] =
  165. {
  166.     { 0x1f80, 0x1f80, mainevt_bankswitch_w },
  167.     { 0x1f84, 0x1f84, soundlatch_w },                /* probably */
  168.     { 0x1f88, 0x1f88, mainevt_sh_irqtrigger_w },    /* probably */
  169.     { 0x1f8c, 0x1f8d, MWA_NOP },    /* ??? */
  170.     { 0x1f90, 0x1f90, mainevt_coin_w },    /* coin counters + lamps */
  171.  
  172.     { 0x0000, 0x3fff, K052109_051960_w },
  173.     { 0x4000, 0x5dff, MWA_RAM },
  174.     { 0x5e00, 0x5fff, paletteram_xBBBBBGGGGGRRRRR_swap_w, &paletteram },
  175.      { 0x6000, 0xffff, MWA_ROM },
  176.     { -1 }    /* end of table */
  177. };
  178.  
  179.  
  180. static struct MemoryReadAddress dv_readmem[] =
  181. {
  182.     { 0x1f94, 0x1f94, input_port_0_r }, /* Coins */
  183.     { 0x1f95, 0x1f95, input_port_1_r }, /* Player 1 */
  184.     { 0x1f96, 0x1f96, input_port_2_r }, /* Player 2 */
  185.     { 0x1f97, 0x1f97, input_port_5_r }, /* Dip 1 */
  186.     { 0x1f98, 0x1f98, input_port_7_r }, /* Dip 3 */
  187.     { 0x1f9b, 0x1f9b, input_port_6_r }, /* Dip 2 */
  188.     { 0x1fa0, 0x1fbf, K051733_r },
  189.  
  190.     { 0x0000, 0x3fff, K052109_051960_r },
  191.     { 0x4000, 0x5fff, MRA_RAM },
  192.     { 0x6000, 0x7fff, MRA_BANK1 },
  193.     { 0x8000, 0xffff, MRA_ROM },
  194.     { -1 }    /* end of table */
  195. };
  196.  
  197. static struct MemoryWriteAddress dv_writemem[] =
  198. {
  199.     { 0x1f80, 0x1f80, mainevt_bankswitch_w },
  200.     { 0x1f84, 0x1f84, soundlatch_w },                /* probably */
  201.     { 0x1f88, 0x1f88, mainevt_sh_irqtrigger_w },    /* probably */
  202.     { 0x1f90, 0x1f90, mainevt_coin_w },    /* coin counters + lamps */
  203.     { 0x1fb2, 0x1fb2, dv_nmienable_w },
  204.     { 0x1fa0, 0x1fbf, K051733_w },
  205.  
  206.     { 0x0000, 0x3fff, K052109_051960_w },
  207.     { 0x4000, 0x5dff, MWA_RAM },
  208.     { 0x5e00, 0x5fff, paletteram_xBBBBBGGGGGRRRRR_swap_w, &paletteram },
  209.     { 0x6000, 0xffff, MWA_ROM },
  210.     { -1 }    /* end of table */
  211. };
  212.  
  213.  
  214. static struct MemoryReadAddress sound_readmem[] =
  215. {
  216.     { 0x0000, 0x7fff, MRA_ROM },
  217.     { 0x8000, 0x83ff, MRA_RAM },
  218.     { 0xa000, 0xa000, soundlatch_r },
  219.     { 0xb000, 0xb00d, K007232_read_port_0_r },
  220.     { 0xd000, 0xd000, UPD7759_0_busy_r },
  221.     { -1 }    /* end of table */
  222. };
  223.  
  224. static struct MemoryWriteAddress sound_writemem[] =
  225. {
  226.     { 0x0000, 0x7fff, MWA_ROM },
  227.     { 0x8000, 0x83ff, MWA_RAM },
  228.     { 0xb000, 0xb00d, K007232_write_port_0_w },
  229.     { 0x9000, 0x9000, UPD7759_0_message_w },
  230.     { 0xe000, 0xe000, mainevt_sh_irqcontrol_w },
  231.     { 0xf000, 0xf000, mainevt_sh_bankswitch_w },
  232.     { -1 }    /* end of table */
  233. };
  234.  
  235. static struct MemoryReadAddress dv_sound_readmem[] =
  236. {
  237.     { 0x0000, 0x7fff, MRA_ROM },
  238.     { 0x8000, 0x83ff, MRA_RAM },
  239.     { 0xa000, 0xa000, soundlatch_r },
  240.     { 0xb000, 0xb00d, K007232_read_port_0_r },
  241.     { 0xc001, 0xc001, YM2151_status_port_0_r },
  242.     { -1 }    /* end of table */
  243. };
  244.  
  245. static struct MemoryWriteAddress dv_sound_writemem[] =
  246. {
  247.     { 0x0000, 0x7fff, MWA_ROM },
  248.     { 0x8000, 0x83ff, MWA_RAM },
  249.     { 0xb000, 0xb00d, K007232_write_port_0_w },
  250.     { 0xc000, 0xc000, YM2151_register_port_0_w },
  251.     { 0xc001, 0xc001, YM2151_data_port_0_w },
  252.     { 0xe000, 0xe000, devstor_sh_irqcontrol_w },
  253.     { 0xf000, 0xf000, dv_sh_bankswitch_w },
  254.     { -1 }    /* end of table */
  255. };
  256.  
  257.  
  258.  
  259. /*****************************************************************************/
  260.  
  261. INPUT_PORTS_START( mainevt )
  262.     PORT_START    /* IN0 */
  263.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
  264.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
  265.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 )
  266.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN4 )
  267.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE1 )
  268.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SERVICE2 )
  269.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE3 )
  270.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE4 )
  271.  
  272.     PORT_START    /* IN1 */
  273.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_PLAYER1 )
  274.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_PLAYER1 )
  275.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_PLAYER1 )
  276.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_PLAYER1 )
  277.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER1 )
  278.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER1 )
  279.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
  280.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
  281.  
  282.     PORT_START    /* IN2 */
  283.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_PLAYER2 )
  284.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_PLAYER2 )
  285.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_PLAYER2 )
  286.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_PLAYER2 )
  287.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER2 )
  288.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER2 )
  289.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
  290.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
  291.  
  292.     PORT_START    /* IN1 */
  293.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_PLAYER3 )
  294.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_PLAYER3 )
  295.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_PLAYER3 )
  296.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_PLAYER3 )
  297.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER3 )
  298.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER3 )
  299.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
  300.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
  301.  
  302.     PORT_START    /* IN2 */
  303.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_PLAYER4 )
  304.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_PLAYER4 )
  305.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_PLAYER4 )
  306.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_PLAYER4 )
  307.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER4 )
  308.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER4 )
  309.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED )
  310.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED )
  311.  
  312.     PORT_START
  313.     PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coinage ) )
  314.     PORT_DIPSETTING(    0x02, DEF_STR( 4C_1C ) )
  315.     PORT_DIPSETTING(    0x05, DEF_STR( 3C_1C ) )
  316.     PORT_DIPSETTING(    0x08, DEF_STR( 2C_1C ) )
  317.     PORT_DIPSETTING(    0x04, DEF_STR( 3C_2C ) )
  318.     PORT_DIPSETTING(    0x01, DEF_STR( 4C_3C ) )
  319.     PORT_DIPSETTING(    0x0f, DEF_STR( 1C_1C ) )
  320.     PORT_DIPSETTING(    0x00, DEF_STR( 4C_5C ) )
  321.     PORT_DIPSETTING(    0x03, DEF_STR( 3C_4C ) )
  322.     PORT_DIPSETTING(    0x07, DEF_STR( 2C_3C ) )
  323.     PORT_DIPSETTING(    0x0e, DEF_STR( 1C_2C ) )
  324.     PORT_DIPSETTING(    0x06, DEF_STR( 2C_5C ) )
  325.     PORT_DIPSETTING(    0x0d, DEF_STR( 1C_3C ) )
  326.     PORT_DIPSETTING(    0x0c, DEF_STR( 1C_4C ) )
  327.     PORT_DIPSETTING(    0x0b, DEF_STR( 1C_5C ) )
  328.     PORT_DIPSETTING(    0x0a, DEF_STR( 1C_6C ) )
  329.     PORT_DIPSETTING(    0x09, DEF_STR( 1C_7C ) )
  330.     PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) )
  331.     PORT_DIPSETTING(    0x10, DEF_STR( Off ) )
  332.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  333.     PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) )
  334.     PORT_DIPSETTING(    0x20, DEF_STR( Off ) )
  335.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  336.     PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) )
  337.     PORT_DIPSETTING(    0x40, DEF_STR( Off ) )
  338.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  339.     PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
  340.     PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
  341.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  342.  
  343.      PORT_START
  344.     PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
  345.     PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
  346.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  347.     PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
  348.     PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
  349.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  350.     PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
  351.     PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
  352.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  353.     PORT_DIPNAME( 0x18, 0x10, "Bonus Energy" )
  354.     PORT_DIPSETTING(    0x00, "60" )
  355.     PORT_DIPSETTING(    0x08, "70" )
  356.     PORT_DIPSETTING(    0x10, "80" )
  357.     PORT_DIPSETTING(    0x18, "90" )
  358.     PORT_DIPNAME( 0x60, 0x40, DEF_STR( Difficulty ) )
  359.     PORT_DIPSETTING(    0x60, "Easy" )
  360.     PORT_DIPSETTING(    0x40, "Normal" )
  361.     PORT_DIPSETTING(    0x20, "Difficult" )
  362.     PORT_DIPSETTING(    0x00, "Very Difficult" )
  363.     PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) )
  364.     PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
  365.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  366.  
  367.     PORT_START
  368.     PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) )
  369.     PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
  370.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  371.     PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
  372.     PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
  373.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  374.     PORT_SERVICE( 0x04, IP_ACTIVE_LOW )
  375.     PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
  376.     PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
  377.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  378.     PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
  379. INPUT_PORTS_END
  380.  
  381. INPUT_PORTS_START( ringohja )
  382.     PORT_START    /* IN0 */
  383.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
  384.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
  385.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
  386.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
  387.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN3 )
  388.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN4 )
  389.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  390.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  391.  
  392.     PORT_START    /* IN1 */
  393.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_PLAYER1 )
  394.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_PLAYER1 )
  395.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_PLAYER1 )
  396.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_PLAYER1 )
  397.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER1 )
  398.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER1 )
  399.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 | IPF_PLAYER1 )
  400.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
  401.  
  402.     PORT_START    /* IN2 */
  403.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_PLAYER2 )
  404.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_PLAYER2 )
  405.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_PLAYER2 )
  406.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_PLAYER2 )
  407.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER2 )
  408.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER2 )
  409.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 | IPF_PLAYER2 )
  410.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )
  411.  
  412.     PORT_START    /* IN1 */
  413.     PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
  414.  
  415.     PORT_START    /* IN2 */
  416.     PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
  417.  
  418.     PORT_START
  419.     PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) )
  420.     PORT_DIPSETTING(    0x02, DEF_STR( 4C_1C ) )
  421.     PORT_DIPSETTING(    0x05, DEF_STR( 3C_1C ) )
  422.     PORT_DIPSETTING(    0x08, DEF_STR( 2C_1C ) )
  423.     PORT_DIPSETTING(    0x04, DEF_STR( 3C_2C ) )
  424.     PORT_DIPSETTING(    0x01, DEF_STR( 4C_3C ) )
  425.     PORT_DIPSETTING(    0x0f, DEF_STR( 1C_1C ) )
  426.     PORT_DIPSETTING(    0x00, DEF_STR( 4C_5C ) )
  427.     PORT_DIPSETTING(    0x03, DEF_STR( 3C_4C ) )
  428.     PORT_DIPSETTING(    0x07, DEF_STR( 2C_3C ) )
  429.     PORT_DIPSETTING(    0x0e, DEF_STR( 1C_2C ) )
  430.     PORT_DIPSETTING(    0x06, DEF_STR( 2C_5C ) )
  431.     PORT_DIPSETTING(    0x0d, DEF_STR( 1C_3C ) )
  432.     PORT_DIPSETTING(    0x0c, DEF_STR( 1C_4C ) )
  433.     PORT_DIPSETTING(    0x0b, DEF_STR( 1C_5C ) )
  434.     PORT_DIPSETTING(    0x0a, DEF_STR( 1C_6C ) )
  435.     PORT_DIPSETTING(    0x09, DEF_STR( 1C_7C ) )
  436.     PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coin_B ) )
  437.     PORT_DIPSETTING(    0x20, DEF_STR( 4C_1C ) )
  438.     PORT_DIPSETTING(    0x50, DEF_STR( 3C_1C ) )
  439.     PORT_DIPSETTING(    0x80, DEF_STR( 2C_1C ) )
  440.     PORT_DIPSETTING(    0x40, DEF_STR( 3C_2C ) )
  441.     PORT_DIPSETTING(    0x10, DEF_STR( 4C_3C ) )
  442.     PORT_DIPSETTING(    0xf0, DEF_STR( 1C_1C ) )
  443.     PORT_DIPSETTING(    0x00, DEF_STR( 4C_5C ) )
  444.     PORT_DIPSETTING(    0x30, DEF_STR( 3C_4C ) )
  445.     PORT_DIPSETTING(    0x70, DEF_STR( 2C_3C ) )
  446.     PORT_DIPSETTING(    0xe0, DEF_STR( 1C_2C ) )
  447.     PORT_DIPSETTING(    0x60, DEF_STR( 2C_5C ) )
  448.     PORT_DIPSETTING(    0xd0, DEF_STR( 1C_3C ) )
  449.     PORT_DIPSETTING(    0xc0, DEF_STR( 1C_4C ) )
  450.     PORT_DIPSETTING(    0xb0, DEF_STR( 1C_5C ) )
  451.     PORT_DIPSETTING(    0xa0, DEF_STR( 1C_6C ) )
  452.     PORT_DIPSETTING(    0x90, DEF_STR( 1C_7C ) )
  453.  
  454.      PORT_START
  455.     PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
  456.     PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
  457.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  458.     PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
  459.     PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
  460.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  461.     PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
  462.     PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
  463.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  464.     PORT_DIPNAME( 0x18, 0x10, "Bonus Energy" )
  465.     PORT_DIPSETTING(    0x00, "60" )
  466.     PORT_DIPSETTING(    0x08, "70" )
  467.     PORT_DIPSETTING(    0x10, "80" )
  468.     PORT_DIPSETTING(    0x18, "90" )
  469.     PORT_DIPNAME( 0x60, 0x40, DEF_STR( Difficulty ) )
  470.     PORT_DIPSETTING(    0x60, "Easy" )
  471.     PORT_DIPSETTING(    0x40, "Normal" )
  472.     PORT_DIPSETTING(    0x20, "Difficult" )
  473.     PORT_DIPSETTING(    0x00, "Very Difficult" )
  474.     PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) )
  475.     PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
  476.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  477.  
  478.     PORT_START
  479.     PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) )
  480.     PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
  481.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  482.     PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
  483.     PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
  484.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  485.     PORT_SERVICE( 0x04, IP_ACTIVE_LOW )
  486.     PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
  487.     PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
  488.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  489.     PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
  490. INPUT_PORTS_END
  491.  
  492. INPUT_PORTS_START( devstors )
  493.     PORT_START    /* IN0 */
  494.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
  495.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
  496.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN )
  497.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN )
  498.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN3 )
  499.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
  500.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  501.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  502.  
  503.     PORT_START    /* IN1 */
  504.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_PLAYER1 )
  505.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_PLAYER1 )
  506.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_PLAYER1 )
  507.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_PLAYER1 )
  508.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER1 )
  509.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER1 )
  510.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  511.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 )
  512.  
  513.     PORT_START    /* IN2 */
  514.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_PLAYER2 )
  515.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_PLAYER2 )
  516.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_PLAYER2 )
  517.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_PLAYER2 )
  518.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER2 )
  519.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER2 )
  520.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  521.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )
  522.  
  523.     PORT_START
  524.     PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
  525.  
  526.     PORT_START
  527.     PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED )
  528.  
  529.     PORT_START
  530.     PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) )
  531.     PORT_DIPSETTING(    0x02, DEF_STR( 4C_1C ) )
  532.     PORT_DIPSETTING(    0x05, DEF_STR( 3C_1C ) )
  533.     PORT_DIPSETTING(    0x08, DEF_STR( 2C_1C ) )
  534.     PORT_DIPSETTING(    0x04, DEF_STR( 3C_2C ) )
  535.     PORT_DIPSETTING(    0x01, DEF_STR( 4C_3C ) )
  536.     PORT_DIPSETTING(    0x0f, DEF_STR( 1C_1C ) )
  537.     PORT_DIPSETTING(    0x03, DEF_STR( 3C_4C ) )
  538.     PORT_DIPSETTING(    0x07, DEF_STR( 2C_3C ) )
  539.     PORT_DIPSETTING(    0x0e, DEF_STR( 1C_2C ) )
  540.     PORT_DIPSETTING(    0x06, DEF_STR( 2C_5C ) )
  541.     PORT_DIPSETTING(    0x0d, DEF_STR( 1C_3C ) )
  542.     PORT_DIPSETTING(    0x0c, DEF_STR( 1C_4C ) )
  543.     PORT_DIPSETTING(    0x0b, DEF_STR( 1C_5C ) )
  544.     PORT_DIPSETTING(    0x0a, DEF_STR( 1C_6C ) )
  545.     PORT_DIPSETTING(    0x09, DEF_STR( 1C_7C ) )
  546.     PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
  547.     PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coin_B ) )
  548.     PORT_DIPSETTING(    0x20, DEF_STR( 4C_1C ) )
  549.     PORT_DIPSETTING(    0x50, DEF_STR( 3C_1C ) )
  550.     PORT_DIPSETTING(    0x80, DEF_STR( 2C_1C ) )
  551.     PORT_DIPSETTING(    0x40, DEF_STR( 3C_2C ) )
  552.     PORT_DIPSETTING(    0x10, DEF_STR( 4C_3C ) )
  553.     PORT_DIPSETTING(    0xf0, DEF_STR( 1C_1C ) )
  554.     PORT_DIPSETTING(    0x30, DEF_STR( 3C_4C ) )
  555.     PORT_DIPSETTING(    0x70, DEF_STR( 2C_3C ) )
  556.     PORT_DIPSETTING(    0xe0, DEF_STR( 1C_2C ) )
  557.     PORT_DIPSETTING(    0x60, DEF_STR( 2C_5C ) )
  558.     PORT_DIPSETTING(    0xd0, DEF_STR( 1C_3C ) )
  559.     PORT_DIPSETTING(    0xc0, DEF_STR( 1C_4C ) )
  560.     PORT_DIPSETTING(    0xb0, DEF_STR( 1C_5C ) )
  561.     PORT_DIPSETTING(    0xa0, DEF_STR( 1C_6C ) )
  562.     PORT_DIPSETTING(    0x90, DEF_STR( 1C_7C ) )
  563. //    PORT_DIPSETTING(    0x00, "Invalid" )
  564.  
  565.      PORT_START
  566.     PORT_DIPNAME( 0x03, 0x02, DEF_STR( Lives ) )
  567.     PORT_DIPSETTING(    0x03, "2" )
  568.     PORT_DIPSETTING(    0x02, "3" )
  569.     PORT_DIPSETTING(    0x01, "5" )
  570.     PORT_DIPSETTING(    0x00, "7" )
  571.     PORT_DIPNAME( 0x04, 0x00, DEF_STR( Cabinet ) )
  572.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  573.     PORT_DIPSETTING(    0x04, DEF_STR( Cocktail ) )
  574.     PORT_DIPNAME( 0x18, 0x18, DEF_STR( Bonus_Life ) )
  575.     PORT_DIPSETTING(    0x18, "150 and every 200" )
  576.     PORT_DIPSETTING(    0x10, "150 and every 250" )
  577.     PORT_DIPSETTING(    0x08, "150" )
  578.     PORT_DIPSETTING(    0x00, "200" )
  579.     PORT_DIPNAME( 0x60, 0x60, DEF_STR( Difficulty ) )
  580.     PORT_DIPSETTING(    0x60, "Easy" )
  581.     PORT_DIPSETTING(    0x40, "Normal" )
  582.     PORT_DIPSETTING(    0x20, "Difficult" )
  583.     PORT_DIPSETTING(    0x00, "Very Difficult" )
  584.     PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) )
  585.     PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
  586.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  587.  
  588.     PORT_START
  589.     PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) )
  590.     PORT_DIPSETTING(    0x01, DEF_STR( Off ) )
  591.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  592.     PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
  593.     PORT_DIPSETTING(    0x02, DEF_STR( Off ) )
  594.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  595.     PORT_SERVICE( 0x04, IP_ACTIVE_LOW )
  596.     PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
  597.     PORT_DIPSETTING(    0x08, DEF_STR( Off ) )
  598.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  599.     PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
  600. INPUT_PORTS_END
  601.  
  602. /*****************************************************************************/
  603.  
  604. static void volume_callback(int v)
  605. {
  606.     K007232_set_volume(0,0,(v >> 4) * 0x11,0);
  607.     K007232_set_volume(0,1,0,(v & 0x0f) * 0x11);
  608. }
  609.  
  610. static struct K007232_interface k007232_interface =
  611. {
  612.     1,        /* number of chips */
  613.     { REGION_SOUND1 },    /* memory regions */
  614.     { K007232_VOL(20,MIXER_PAN_CENTER,20,MIXER_PAN_CENTER) },    /* volume */
  615.     { volume_callback }    /* external port callback */
  616. };
  617.  
  618. static struct UPD7759_interface upd7759_interface =
  619. {
  620.     1,        /* number of chips */
  621.     UPD7759_STANDARD_CLOCK,
  622.     { 50 }, /* volume */
  623.     { REGION_SOUND2 },        /* memory region */
  624.     UPD7759_STANDALONE_MODE,        /* chip mode */
  625.     {0}
  626. };
  627.  
  628. static struct YM2151interface ym2151_interface =
  629. {
  630.     1,            /* 1 chip */
  631.     3579545,    /* 3.579545 MHz */
  632.     { YM3012_VOL(30,MIXER_PAN_CENTER,30,MIXER_PAN_CENTER) },
  633.     { 0 }
  634. };
  635.  
  636. static struct MachineDriver machine_driver_mainevt =
  637. {
  638.     /* basic machine hardware */
  639.     {
  640.          {
  641.             CPU_HD6309,
  642.             3000000,    /* ?? */
  643.             readmem,writemem,0,0,
  644.             mainevt_interrupt,1
  645.         },
  646.         {
  647.             CPU_Z80 | CPU_AUDIO_CPU,
  648.             3579545,    /* 3.579545 MHz */
  649.             sound_readmem,sound_writemem,0,0,
  650.             nmi_interrupt,8    /* ??? */
  651.         }
  652.     },
  653.     60, DEFAULT_60HZ_VBLANK_DURATION,    /* frames per second, vblank duration */
  654.     1,    /* 1 CPU slice per frame - interleaving is forced when a sound command is written */
  655.     0,
  656.  
  657.     /* video hardware */
  658.     64*8, 32*8, { 14*8, (64-14)*8-1, 2*8, 30*8-1 },
  659.     0,    /* gfx decoded by konamiic.c */
  660.     256, 256,
  661.     0,
  662.  
  663.     VIDEO_TYPE_RASTER | VIDEO_MODIFIES_PALETTE,
  664.     0,
  665.     mainevt_vh_start,
  666.     mainevt_vh_stop,
  667.     mainevt_vh_screenrefresh,
  668.  
  669.     /* sound hardware */
  670.     0,0,0,0,
  671.     {
  672.         {
  673.             SOUND_K007232,
  674.             &k007232_interface,
  675.         },
  676.         {
  677.             SOUND_UPD7759,
  678.             &upd7759_interface
  679.         }
  680.     }
  681. };
  682.  
  683. static struct MachineDriver machine_driver_devstors =
  684. {
  685.     /* basic machine hardware */
  686.     {
  687.          {
  688.             CPU_HD6309,
  689.             3000000,    /* ?? */
  690.             dv_readmem,dv_writemem,0,0,
  691.             dv_interrupt,1
  692.         },
  693.         {
  694.             CPU_Z80 | CPU_AUDIO_CPU,
  695.             3579545,    /* 3.579545 MHz */
  696.             dv_sound_readmem,dv_sound_writemem,0,0,
  697.             interrupt,4
  698.         }
  699.     },
  700.     60, DEFAULT_60HZ_VBLANK_DURATION,    /* frames per second, vblank duration */
  701.     1,    /* 1 CPU slice per frame - interleaving is forced when a sound command is written */
  702.     0,
  703.  
  704.     /* video hardware */
  705.     64*8, 32*8, { 13*8, (64-13)*8-1, 2*8, 30*8-1 },
  706.     0,    /* gfx decoded by konamiic.c */
  707.     256, 256,
  708.     0,
  709.  
  710.     VIDEO_TYPE_RASTER | VIDEO_MODIFIES_PALETTE,
  711.     0,
  712.     dv_vh_start,
  713.     mainevt_vh_stop,
  714.     dv_vh_screenrefresh,
  715.  
  716.     /* sound hardware */
  717.     0,0,0,0,
  718.     {
  719.         {
  720.             SOUND_YM2151,
  721.             &ym2151_interface
  722.         },
  723.         {
  724.             SOUND_K007232,
  725.             &k007232_interface,
  726.         }
  727.     }
  728. };
  729.  
  730.  
  731.  
  732. /***************************************************************************
  733.  
  734.   Game driver(s)
  735.  
  736. ***************************************************************************/
  737.  
  738. ROM_START( mainevt )
  739.     ROM_REGION( 0x40000, REGION_CPU1 )
  740.     ROM_LOAD( "799c02.k11",   0x10000, 0x08000, 0xe2e7dbd5 )
  741.     ROM_CONTINUE(             0x08000, 0x08000 )
  742.  
  743.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for the audio CPU */
  744.     ROM_LOAD( "799c01.f7",    0x00000, 0x08000, 0x447c4c5c )
  745.  
  746.     ROM_REGION( 0x20000, REGION_GFX1 )    /* graphics (addressable by the main CPU) */
  747.     ROM_LOAD_GFX_EVEN( "799c06.f22",   0x00000, 0x08000, 0xf839cb58 )
  748.     ROM_LOAD_GFX_ODD ( "799c07.h22",   0x00000, 0x08000, 0x176df538 )
  749.     ROM_LOAD_GFX_EVEN( "799c08.j22",   0x10000, 0x08000, 0xd01e0078 )
  750.     ROM_LOAD_GFX_ODD ( "799c09.k22",   0x10000, 0x08000, 0x9baec75e )
  751.  
  752.     ROM_REGION( 0x100000, REGION_GFX2 )    /* graphics (addressable by the main CPU) */
  753.     ROM_LOAD( "799b04.h4",    0x00000, 0x80000, 0x323e0c2b )
  754.     ROM_LOAD( "799b05.k4",    0x80000, 0x80000, 0x571c5831 )
  755.  
  756.     ROM_REGION( 0x0100, REGION_PROMS )
  757.     ROM_LOAD( "63s141n.bin",  0x0000, 0x0100, 0x61f6c8d1 )    /* priority encoder (not used) */
  758.  
  759.     ROM_REGION( 0x80000, REGION_SOUND1 )    /* 512k for 007232 samples */
  760.     ROM_LOAD( "799b03.d4",    0x00000, 0x80000, 0xf1cfd342 )
  761.  
  762.     ROM_REGION( 0xa0000, REGION_SOUND2 )    /* 128+512k for the UPD7759C samples */
  763.     /* 00000-1ffff space where the following ROM is bank switched */
  764.     ROM_LOAD( "799b06.c22",   0x20000, 0x80000, 0x2c8c47d7 )
  765. ROM_END
  766.  
  767. ROM_START( mainevt2 )
  768.     ROM_REGION( 0x40000, REGION_CPU1 )
  769.     ROM_LOAD( "02",           0x10000, 0x08000, 0xc143596b )
  770.     ROM_CONTINUE(             0x08000, 0x08000 )
  771.  
  772.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for the audio CPU */
  773.     ROM_LOAD( "799c01.f7",    0x00000, 0x08000, 0x447c4c5c )
  774.  
  775.     ROM_REGION( 0x20000, REGION_GFX1 )    /* graphics (addressable by the main CPU) */
  776.     ROM_LOAD_GFX_EVEN( "799c06.f22",   0x00000, 0x08000, 0xf839cb58 )
  777.     ROM_LOAD_GFX_ODD ( "799c07.h22",   0x00000, 0x08000, 0x176df538 )
  778.     ROM_LOAD_GFX_EVEN( "799c08.j22",   0x10000, 0x08000, 0xd01e0078 )
  779.     ROM_LOAD_GFX_ODD ( "799c09.k22",   0x10000, 0x08000, 0x9baec75e )
  780.  
  781.     ROM_REGION( 0x100000, REGION_GFX2 )    /* graphics (addressable by the main CPU) */
  782.     ROM_LOAD( "799b04.h4",    0x00000, 0x80000, 0x323e0c2b )
  783.     ROM_LOAD( "799b05.k4",    0x80000, 0x80000, 0x571c5831 )
  784.  
  785.     ROM_REGION( 0x0100, REGION_PROMS )
  786.     ROM_LOAD( "63s141n.bin",  0x0000, 0x0100, 0x61f6c8d1 )    /* priority encoder (not used) */
  787.  
  788.     ROM_REGION( 0x80000, REGION_SOUND1 )    /* 512k for 007232 samples */
  789.     ROM_LOAD( "799b03.d4",    0x00000, 0x80000, 0xf1cfd342 )
  790.  
  791.     ROM_REGION( 0xa0000, REGION_SOUND2 )    /* 128+512k for the UPD7759C samples */
  792.     /* 00000-1ffff space where the following ROM is bank switched */
  793.     ROM_LOAD( "799b06.c22",   0x20000, 0x80000, 0x2c8c47d7 )
  794. ROM_END
  795.  
  796. ROM_START( ringohja )
  797.     ROM_REGION( 0x40000, REGION_CPU1 )
  798.     ROM_LOAD( "799n02.k11",   0x10000, 0x08000, 0xf9305dd0 )
  799.     ROM_CONTINUE(             0x08000, 0x08000 )
  800.  
  801.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for the audio CPU */
  802.     ROM_LOAD( "799c01.f7",    0x00000, 0x08000, 0x447c4c5c )
  803.  
  804.     ROM_REGION( 0x20000, REGION_GFX1 )    /* graphics (addressable by the main CPU) */
  805.     ROM_LOAD_GFX_EVEN( "799c06.f22",   0x00000, 0x08000, 0xf839cb58 )
  806.     ROM_LOAD_GFX_ODD ( "799c07.h22",   0x00000, 0x08000, 0x176df538 )
  807.     ROM_LOAD_GFX_EVEN( "799c08.j22",   0x10000, 0x08000, 0xd01e0078 )
  808.     ROM_LOAD_GFX_ODD ( "799c09.k22",   0x10000, 0x08000, 0x9baec75e )
  809.  
  810.     ROM_REGION( 0x100000, REGION_GFX2 )    /* graphics (addressable by the main CPU) */
  811.     ROM_LOAD( "799b04.h4",    0x00000, 0x80000, 0x323e0c2b )
  812.     ROM_LOAD( "799b05.k4",    0x80000, 0x80000, 0x571c5831 )
  813.  
  814.     ROM_REGION( 0x0100, REGION_PROMS )
  815.     ROM_LOAD( "63s141n.bin",  0x0000, 0x0100, 0x61f6c8d1 )    /* priority encoder (not used) */
  816.  
  817.     ROM_REGION( 0x80000, REGION_SOUND1 )    /* 512k for 007232 samples */
  818.     ROM_LOAD( "799b03.d4",    0x00000, 0x80000, 0xf1cfd342 )
  819.  
  820.     ROM_REGION( 0xa0000, REGION_SOUND2 )    /* 128+512k for the UPD7759C samples */
  821.     /* 00000-1ffff space where the following ROM is bank switched */
  822.     ROM_LOAD( "799b06.c22",   0x20000, 0x80000, 0x2c8c47d7 )
  823. ROM_END
  824.  
  825. ROM_START( devstors )
  826.     ROM_REGION( 0x40000, REGION_CPU1 )
  827.     ROM_LOAD( "890-z02.k11",  0x10000, 0x08000, 0xebeb306f )
  828.     ROM_CONTINUE(             0x08000, 0x08000 )
  829.  
  830.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for the audio CPU */
  831.     ROM_LOAD( "dev-k01.rom",  0x00000, 0x08000, 0xd44b3eb0 )
  832.  
  833.     ROM_REGION( 0x40000, REGION_GFX1 )    /* graphics (addressable by the main CPU) */
  834.     ROM_LOAD_GFX_EVEN( "dev-f06.rom",  0x00000, 0x10000, 0x26592155 )
  835.     ROM_LOAD_GFX_ODD ( "dev-f07.rom",  0x00000, 0x10000, 0x6c74fa2e )
  836.     ROM_LOAD_GFX_EVEN( "dev-f08.rom",  0x20000, 0x10000, 0x29e12e80 )
  837.     ROM_LOAD_GFX_ODD ( "dev-f09.rom",  0x20000, 0x10000, 0x67ca40d5 )
  838.  
  839.     ROM_REGION( 0x100000, REGION_GFX2 )    /* graphics (addressable by the main CPU) */
  840.     ROM_LOAD( "dev-f04.rom",  0x00000, 0x80000, 0xf16cd1fa )
  841.     ROM_LOAD( "dev-f05.rom",  0x80000, 0x80000, 0xda37db05 )
  842.  
  843.     ROM_REGION( 0x0100, REGION_PROMS )
  844.     ROM_LOAD( "devaprom.bin", 0x0000, 0x0100, 0xd3620106 )    /* priority encoder (not used) */
  845.  
  846.     ROM_REGION( 0x80000, REGION_SOUND1 )    /* 512k for 007232 samples */
  847.      ROM_LOAD( "dev-f03.rom",  0x00000, 0x80000, 0x19065031 )
  848. ROM_END
  849.  
  850. ROM_START( devstor2 )
  851.     ROM_REGION( 0x40000, REGION_CPU1 )
  852.     ROM_LOAD( "dev-x02.rom",  0x10000, 0x08000, 0xe58ebb35 )
  853.     ROM_CONTINUE(             0x08000, 0x08000 )
  854.  
  855.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for the audio CPU */
  856.     ROM_LOAD( "dev-k01.rom",  0x00000, 0x08000, 0xd44b3eb0 )
  857.  
  858.     ROM_REGION( 0x40000, REGION_GFX1 )    /* graphics (addressable by the main CPU) */
  859.     ROM_LOAD_GFX_EVEN( "dev-f06.rom",  0x00000, 0x10000, 0x26592155 )
  860.     ROM_LOAD_GFX_ODD ( "dev-f07.rom",  0x00000, 0x10000, 0x6c74fa2e )
  861.     ROM_LOAD_GFX_EVEN( "dev-f08.rom",  0x20000, 0x10000, 0x29e12e80 )
  862.     ROM_LOAD_GFX_ODD ( "dev-f09.rom",  0x20000, 0x10000, 0x67ca40d5 )
  863.  
  864.     ROM_REGION( 0x100000, REGION_GFX2 )    /* graphics (addressable by the main CPU) */
  865.     ROM_LOAD( "dev-f04.rom",  0x00000, 0x80000, 0xf16cd1fa )
  866.     ROM_LOAD( "dev-f05.rom",  0x80000, 0x80000, 0xda37db05 )
  867.  
  868.     ROM_REGION( 0x0100, REGION_PROMS )
  869.     ROM_LOAD( "devaprom.bin", 0x0000, 0x0100, 0xd3620106 )    /* priority encoder (not used) */
  870.  
  871.     ROM_REGION( 0x80000, REGION_SOUND1 )    /* 512k for 007232 samples */
  872.      ROM_LOAD( "dev-f03.rom",  0x00000, 0x80000, 0x19065031 )
  873. ROM_END
  874.  
  875. ROM_START( devstor3 )
  876.     ROM_REGION( 0x40000, REGION_CPU1 )
  877.     ROM_LOAD( "890k02.k11",   0x10000, 0x08000, 0x52f4ccdd )
  878.     ROM_CONTINUE(             0x08000, 0x08000 )
  879.  
  880.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for the audio CPU */
  881.     ROM_LOAD( "dev-k01.rom",  0x00000, 0x08000, 0xd44b3eb0 )
  882.  
  883.     ROM_REGION( 0x40000, REGION_GFX1 )    /* graphics (addressable by the main CPU) */
  884.     ROM_LOAD_GFX_EVEN( "dev-f06.rom",  0x00000, 0x10000, 0x26592155 )
  885.     ROM_LOAD_GFX_ODD ( "dev-f07.rom",  0x00000, 0x10000, 0x6c74fa2e )
  886.     ROM_LOAD_GFX_EVEN( "dev-f08.rom",  0x20000, 0x10000, 0x29e12e80 )
  887.     ROM_LOAD_GFX_ODD ( "dev-f09.rom",  0x20000, 0x10000, 0x67ca40d5 )
  888.  
  889.     ROM_REGION( 0x100000, REGION_GFX2 )    /* graphics (addressable by the main CPU) */
  890.     ROM_LOAD( "dev-f04.rom",  0x00000, 0x80000, 0xf16cd1fa )
  891.     ROM_LOAD( "dev-f05.rom",  0x80000, 0x80000, 0xda37db05 )
  892.  
  893.     ROM_REGION( 0x0100, REGION_PROMS )
  894.     ROM_LOAD( "devaprom.bin", 0x0000, 0x0100, 0xd3620106 )    /* priority encoder (not used) */
  895.  
  896.     ROM_REGION( 0x80000, REGION_SOUND1 )    /* 512k for 007232 samples */
  897.      ROM_LOAD( "dev-f03.rom",  0x00000, 0x80000, 0x19065031 )
  898. ROM_END
  899.  
  900. ROM_START( garuka )
  901.     ROM_REGION( 0x40000, REGION_CPU1 )
  902.     ROM_LOAD( "890w02.bin",   0x10000, 0x08000, 0xb2f6f538 )
  903.     ROM_CONTINUE(             0x08000, 0x08000 )
  904.  
  905.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for the audio CPU */
  906.     ROM_LOAD( "dev-k01.rom",  0x00000, 0x08000, 0xd44b3eb0 )
  907.  
  908.     ROM_REGION( 0x40000, REGION_GFX1 )    /* graphics (addressable by the main CPU) */
  909.     ROM_LOAD_GFX_EVEN( "dev-f06.rom",  0x00000, 0x10000, 0x26592155 )
  910.     ROM_LOAD_GFX_ODD ( "dev-f07.rom",  0x00000, 0x10000, 0x6c74fa2e )
  911.     ROM_LOAD_GFX_EVEN( "dev-f08.rom",  0x20000, 0x10000, 0x29e12e80 )
  912.     ROM_LOAD_GFX_ODD ( "dev-f09.rom",  0x20000, 0x10000, 0x67ca40d5 )
  913.  
  914.     ROM_REGION( 0x100000, REGION_GFX2 )    /* graphics (addressable by the main CPU) */
  915.     ROM_LOAD( "dev-f04.rom",  0x00000, 0x80000, 0xf16cd1fa )
  916.     ROM_LOAD( "dev-f05.rom",  0x80000, 0x80000, 0xda37db05 )
  917.  
  918.     ROM_REGION( 0x0100, REGION_PROMS )
  919.     ROM_LOAD( "devaprom.bin", 0x0000, 0x0100, 0xd3620106 )    /* priority encoder (not used) */
  920.  
  921.     ROM_REGION( 0x80000, REGION_SOUND1 )    /* 512k for 007232 samples */
  922.      ROM_LOAD( "dev-f03.rom",  0x00000, 0x80000, 0x19065031 )
  923. ROM_END
  924.  
  925.  
  926.  
  927. static void init_mainevt(void)
  928. {
  929.     konami_rom_deinterleave_2(REGION_GFX1);
  930.     konami_rom_deinterleave_2(REGION_GFX2);
  931. }
  932.  
  933.  
  934.  
  935. GAME( 1988, mainevt,  0,        mainevt,  mainevt,  mainevt, ROT0,  "Konami", "The Main Event (version Y)" )
  936. GAME( 1988, mainevt2, mainevt,  mainevt,  mainevt,  mainevt, ROT0,  "Konami", "The Main Event (version F)" )
  937. GAME( 1988, ringohja, mainevt,  mainevt,  ringohja, mainevt, ROT0,  "Konami", "Ring no Ohja (Japan)" )
  938. GAME( 1988, devstors, 0,        devstors, devstors, mainevt, ROT90, "Konami", "Devastators (version Z)" )
  939. GAME( 1988, devstor2, devstors, devstors, devstors, mainevt, ROT90, "Konami", "Devastators (version X)" )
  940. GAME( 1988, devstor3, devstors, devstors, devstors, mainevt, ROT90, "Konami", "Devastators (version V)" )
  941. GAME( 1988, garuka,   devstors, devstors, devstors, mainevt, ROT90, "Konami", "Garuka (Japan)" )
  942.